<template>
    <view>
        <uni-section :type="type" :title="title" :titleFontSize="titleFontSize" :titleColor="titleColor"
            :subTitle="subTitle" :subTitleFontSize="subTitleFontSize" :subTitleColor="subTitleColor"
            :padding="padding"></uni-section>
        <view class="py-section-text" v-if="text">
            <u--text :text="text"></u--text>
        </view>
        <view class="py-section-slot">
            <slot></slot>
        </view>
        <u-line></u-line>


    </view>
</template>
<script>
    export default {
        name: "PySection",
        props: {
            // 新增属性开始
            // text显示的值
            text: {
                type: [String, Number],
                default: undefined
            },
            // 新增属性结束
            // uni-section自带属性开始
            type: {
                type: String,
                default: 'line'
            },
            title: {
                type: String,
                required: true,
                default: ''
            },
            titleFontSize: {
                type: String,
                default: '14px'
            },
            titleColor: {
                type: String,
                default: '#2979ff'
            },
            subTitle: {
                type: String,
                default: ''
            },
            subTitleFontSize: {
                type: String,
                default: '12px'
            },
            subTitleColor: {
                type: String,
                default: '#999'
            },
            padding: {
                type: [Boolean, String],
                default: false
            }
        },
    }
</script>
<style lang="css" scoped>
    .py-section-text,
    .py-section-slot {
        padding: 5px 10px;
    }
</style>